package reseauSocial;

import java.io.IOException;
import java.util.ArrayList;
import main.SYRRES;
import core.Review;
import core.SetBeer;
import core.SetUser;

public class ReseauSocial {
	private SetUser allUser;
	private SetBeer allBeer;
	
	private float[] note_coeff = new float[SYRRES.NB_NOTE];	
	
	private Similarity similarity;
	private PredictNote predictNode;

	public ReseauSocial(ArrayList<Review> allReview, SetUser allUser, SetBeer allBeer) {
		/* SIMILARITE */
		this.allUser = allUser;

		// Initialiser les coefficients 
		note_coeff = new float[] {0.1f, 0.1f, 0.1f, 0.1f, 0.6f};
		similarity = new Similarity(allUser, note_coeff);
			
		/* PREDIRE LES NOTES */
		this.setAllBeer(allBeer);		
		
		predictNode = new PredictNote(allBeer, allUser);
	}
	
	public void calculSimilarity(int threshold, boolean withWeight) {
		try {
			similarity.calculSimilarity(threshold, withWeight);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void predictNotes(int threshold) {
		predictNode.predict(threshold);
	}

	public SetUser getAllUser() {
		return allUser;
	}

	public void setAllUser(SetUser allUser) {
		this.allUser = allUser;
	}	

	public SetBeer getAllBeer() {
		return allBeer;
	}

	public void setAllBeer(SetBeer allBeer) {
		this.allBeer = allBeer;
	}	
}
